Many animal behaviors are organized into long-lasting states, perhaps most strikingly in the sleep/wake and emotional states that mammals display. However, the fundamental mechanisms that allow animals to initiate, maintain and terminate these states are unknown. Biogenic amine and neuropeptide neuromodulators are critical for the generation of behavioral states, but a mechanistic understanding of how neuromodulators act on circuits to generate stable circuit-wide patterns of neural activity has been lacking, largely due to the complexity of neuromodulation in mammalian circuits. We have chosen to tackle this problem using C. elegans, a nematode whose nervous system consists of 302 neurons with a fully defined wiring diagram. We previously characterized C. elegans movement patterns and showed that feeding animals transition between two stable arousal states, roaming and dwelling. We characterized the neural circuit that generates roaming and dwelling states, and found that two opposing neuromodulators, serotonin and the neuropeptide PDF, act on a defined neural circuit to generate this bi-stable behavior: serotonin action on the circuit stabilizes dwelling states, while PDF stabilizes roaming states. Now that we have defined a neuromodulatory circuit that generates persistent behavioral states, we are poised to resolve several fundamental questions about neural circuit function and organization. Here, we propose to dissect mechanisms of neural circuit persistence by examining how specific neuromodulators reconfigure neural circuits to stabilize circuit-wide activity patterns that give rise to long-lasting behavioral states. Resolving this question requires whole-circuit measurements of neural activity as animals freely transition between states. Thus, we have already developed a new imaging technology that allows us to simultaneously monitor the activity of every neuron in a circuit in freely-moving C. elegans animals. By combining this imaging technology with genetic/optogenetic manipulations and new analysis/modeling methods, we will illustrate a new multi-disciplinary approach that can be used to dissect the mechanisms by which collective neural dynamics arise in a circuit. First, we will first identify the circuit-wide patterns of activity that define different behavioral states (Aim 1). Second, we will perturb this system to examine how neuromodulators act on specific neurons in the circuit to generate these stable circuit-wide patterns of activity (Aim 2). Finally, we will determine how activity in this neuromodulatory circuit is altered by changes in the environment and, after simultaneously recording the sensory neurons that feed into this circuit, we will develop a network model that describes how noisy sensory inputs are transformed into a bi-stable behavioral state output (Aim 3). These studies will provide new mechanistic insights into how neuromodulators orchestrate whole-circuit changes in activity to influence behavior. By providing quantitative links between specific sites of neuromodulation, whole-circuit dynamics, and emergent behaviors, these studies will yield a generalizable model for circuit function that will bear on studies of sleep/wake states, emotional states, and cognitive states.